package com.YCH.user.controller.v1;

import com.YCH.apis.user.apis.MaterialManageControllerApi;
import com.YCH.model.common.dtos.ResponseResult;
import com.YCH.user.service.MaterialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/api/v1/author/material")
public class MaterialManageController implements MaterialManageControllerApi {

	@Autowired
	private MaterialService materialService;

	@PostMapping(value="/upload_picture",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
	@Override
	public ResponseResult uploadPicture(@RequestPart("file") MultipartFile file) {
		return materialService.uploadPicture(file);
	}  
}